home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 8683 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  900 b 

  1. Path: nntp.coast.net!torn!nott!uottawa!ctran
  2. From: ctran@csi.uottawa.ca (Charles Tran)
  3. Newsgroups: comp.lang.c
  4. Subject: Handling complex numbers...
  5. Date: 5 Mar 1996 18:26:43 GMT
  6. Organization: University of Ottawa
  7. Distribution: world
  8. Message-ID: <4hi113$2i8k@mercury.cc.uottawa.ca>
  9. NNTP-Posting-Host: ai0.csi.uottawa.ca
  10. Mime-Version: 1.0
  11. Content-Type: Text/Plain; charset=ISO-8859-1
  12. Content-Transfer-Encoding: 8bit
  13.  
  14. Dear fellow netters,
  15.  
  16. Can someone kindly explain to me how to represent complex numbers in C?
  17. I am writing a numerical method program to calculate the area under
  18. a curve using Simpson's Rule.  The problem that I face right now is
  19. the representation of "i" (where i^2 = -1) in my C program.
  20.  
  21. Here's a simple example of what I mean:
  22.   
  23.   _b
  24.  |           
  25.  | exp(ix) dx 
  26. _|             
  27. a
  28.  
  29.  
  30. How do I implement this function exp(ix)?
  31.  
  32. I'm grateful for your help.
  33.  
  34. Charles Tran
  35. -- 
  36. Charles
  37.